2 // DPCoroutineMultiThreadTests.m
3 // HigherOrderMessaging
5 // Created by Ofri Wolfus on 03/08/07.
6 // Copyright 2007 Ofri Wolfus. All rights reserved.
9 #import "DPCoroutineMultiThreadTests.h"
10 #import "DPCoroutine.h"
13 @implementation DPCoroutineMultiThreadTests
15 - (unsigned)numberOfIterations {
20 while (OSAtomicIncrement32Barrier(&count) < 5) {
25 - (void)checkCompletion {
36 [self setStatus:YES forPendingTest:@"testMultiThreaded"];
39 - (void)generateJobs {
40 [pool sendCoroutineMessage:MSG(incByOne)
45 [pool sendCoroutineMessage:MSG(checkCompletion)
50 - (void)testMultiThreaded {
52 pool = [[DPThreadPool alloc] init];
54 // Let UITestingKit mark us as a pending test.
55 // Yes, its a bug but I'm not feeling like fixing it right now.
56 [self receiveMessage:MSG(generateJobs)